﻿using System;
using System.Linq.Expressions;

using NUnit.Framework;

using StructureMap.AutoMocking;
using StructureMap.Testing.AutoMocking;

using TypeMock;
using TypeMock.ArrangeActAssert;

using StructureMap.TypeMockAutoMocker;

namespace StructureMap.TypeMockAutoMocker
{
	[TestFixture]
	public class AaaAutoMockerTester: AutoMockerTester
	{
		#region Setup/Teardown

		[SetUp]
		public void SetUp()
		{
			MockManager.Init();
		}

		#endregion

		protected override AutoMocker<T> createAutoMocker<T>()
		{
			return new TypeMockAutoMocker<T>();
		}

		protected override void setExpectation<T, TResult>(T mock, Expression<Func<T, TResult>> functionCall, TResult expectedResult)
		{
			var compiledCall = functionCall.Compile();
			Isolate.WhenCalled(() => compiledCall(mock)).WillReturn(expectedResult);
		}

		


	
	}
}